﻿using FreeSql;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.Model.Enum;

namespace CKS.PLC.Action.Subscription.OP020
{
    /// <summary>
    /// 主要是针对无法上传零件消耗，进行匹配式扣减
    /// OP20_2 保存完数据 触发零件扣减
    /// </summary>
    public class OP20SaveDataAction: SaveProcessingResults
    {
        /// <summary>
        /// DB块3051，保存总结果
        /// </summary>
        /// <param name="_value"></param>
        public OP20SaveDataAction(DecodeValue _value) : base(_value)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="conn"></param>
        public override AfterSaveResult AfterSaved(SaveArg e)
        {
            string batchNo = GetPartBatchNo((int)PartTypeEnum.定位柱小焊环);
            UpdateBasketStockWithConn(PartTypeEnum.定位柱小焊环);


            //var table = e.TableInfo;
            //var dict = new Dictionary<string, object>();
            //dict["Id"] = e.InsertIdentityId;
            //dict["SmallSolderRingBatchCode"] = batchNo;
            //UpdateDynamicTableData(table, dict);
           

            return base.AfterSaved(e);
        }
    }
}
